package com.smfx.yxt.view;

import java.util.Date;

import org.apache.commons.lang.StringUtils;

import com.smfx.yxt.common.Const;
import com.smfx.yxt.utils.StringUtil;
import com.smfx.yxt.wechat.utils.WechatGlobalMap;

public class PointItemView {

	private String termName;
	
	private Integer termId;
	
	private Integer targetType;
	
	private String targetName;
	
	private String judgeType;
	
	private String judgeContent;
	
	private Float score;
	
	private String judgeDepart;
	
	private String judgeTeacher;
	
	private String subjectText;
	
	private String gradeText;
	
	private Integer clazz;
	
	private Date createTime;

	public String getTermName() {
		return termName;
	}

	public void setTermName(String termName) {
		this.termName = StringUtil.nullToEmpty(termName);
	}

	public Integer getTermId() {
		return termId;
	}

	public void setTermId(Integer termId) {
		this.termId = termId;
	}

	public String getTargetName() {
		return targetName;
	}

	public void setTargetName(String targetName) {
		if(targetType != null && targetType == 1) {
			TermView view = (TermView) WechatGlobalMap.get(Const.CACHE_TERM).getValue();
			String gradeText = view.getGradeName(Integer.valueOf(targetName.substring(0, 4))) + 
				"(" + targetName.substring(4, targetName.length()) + ")班";
			this.targetName = StringUtil.nullToEmpty(gradeText);
		}else {
			this.targetName = StringUtil.nullToEmpty(targetName);
		}
	}

	public String getJudgeType() {
		return judgeType;
	}

	public void setJudgeType(String judgeType) {
		this.judgeType = StringUtil.nullToEmpty(judgeType);
	}

	public String getJudgeContent() {
		return judgeContent;
	}

	public void setJudgeContent(String judgeContent) {
		this.judgeContent = StringUtil.nullToEmpty(judgeContent);
	}

	public Float getScore() {
		return score;
	}

	public void setScore(Float score) {
		this.score = score;
	}

	public String getJudgeDepart() {
		return judgeDepart;
	}

	public void setJudgeDepart(String judgeDepart) {
		this.judgeDepart = StringUtil.nullToEmpty(judgeDepart);
	}

	public String getJudgeTeacher() {
		return judgeTeacher;
	}

	public void setJudgeTeacher(String judgeTeacher) {
		this.judgeTeacher = StringUtil.nullToEmpty(judgeTeacher);
	}

	public String getSubjectText() {
		return subjectText;
	}

	public void setSubjectText(String subjectText) {
		this.subjectText = StringUtil.nullToEmpty(subjectText);
	}

	public String getGradeText() {
		return gradeText;
	}

	public void setGradeText(String gradeText) {
		if(StringUtils.isNotBlank(gradeText)) {
			TermView view = (TermView) WechatGlobalMap.get(Const.CACHE_TERM).getValue();
			this.gradeText = StringUtil.nullToEmpty(view.getGradeName(Integer.valueOf(gradeText)));
		}
	}

	public Integer getClazz() {
		return clazz;
	}

	public void setClazz(Integer clazz) {
		this.clazz = clazz;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getTargetType() {
		return targetType;
	}

	public void setTargetType(Integer targetType) {
		this.targetType = targetType;
	}
	
}
